bitkeeper revision 1.1108.2.12 (40fe3dbaxIWEKBVXUkHDWE0aDdMw5w)
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Wed, 21 Jul 2004 09:56:10 +0000 (09:56 +0000)
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Wed, 21 Jul 2004 09:56:10 +0000 (09:56 +0000)
Fix the Xen specific idle loop for good.

linux-2.6.7-xen-sparse/arch/xen/i386/kernel/time.c
linux-2.6.7-xen-sparse/arch/xen/kernel/process.c

index c6fa43f378cd64c013d93654a1f41c55e2b5f37e..f342466a8b308c81fd73cacd785a97ff93f60aa8 100644 (file)
@@ -474,28 +474,23 @@ static inline u64 __jiffies_to_st(unsigned long j)
  * 
  * It must be called with interrupts disabled.
  */
-extern spinlock_t timerlist_lock;
 int set_timeout_timer(void)
 {
-    u64 alarm = 0;
-    int ret = 0;
-    int cpu = smp_processor_id();
-
-    spin_lock(&timerlist_lock);
-
-    /*
-     * This is safe against long blocking (since calculations are not based on 
-     * TSC deltas). It is also safe against warped system time since
-     * suspend-resume is cooperative and we would first get locked out. It is 
-     * safe against normal updates of jiffies since interrupts are off.
-     */
-    alarm = __jiffies_to_st(next_timer_interrupt());
-
-    /* Failure is pretty bad, but we'd best soldier on. */
-    if ( HYPERVISOR_set_timer_op(alarm) != 0 )
-        ret = -1;
-    
-    spin_unlock(&timerlist_lock);
-
-    return ret;
+       u64 alarm = 0;
+       int ret = 0;
+
+       /*
+        * This is safe against long blocking (since calculations are
+        * not based on TSC deltas). It is also safe against warped
+        * system time since suspend-resume is cooperative and we
+        * would first get locked out. It is safe against normal
+        * updates of jiffies since interrupts are off.
+        */
+       alarm = __jiffies_to_st(next_timer_interrupt());
+
+       /* Failure is pretty bad, but we'd best soldier on. */
+       if ( HYPERVISOR_set_timer_op(alarm) != 0 )
+               ret = -1;
+
+       return ret;
 }
index a9282773d6244a6185cfc014e5d294175ebc2aee..f01dc9b8ec575b1fd97d15c08f149b6299bd7c82 100644 (file)
@@ -6,12 +6,16 @@
 #include <linux/init.h>
 #include <linux/platform.h>
 #include <linux/pm.h>
+#include <linux/rcupdate.h>
 
+extern int set_timeout_timer(void);
 
 void xen_cpu_idle (void)
 {
+       int cpu = smp_processor_id();
+
        local_irq_disable();
-       if (need_resched() || !list_empty(&RCU_curlist(cpu)))
+       if (need_resched() || !list_empty(&RCU_curlist(cpu))) {
                local_irq_enable();
                return;
        }